package util;

import play.mvc.Action;
import play.mvc.Http.Context;
import play.mvc.Result;

public class Authenticated extends Action.Simple {
	public final static String USER_ID = "userID";

	@Override
	public Result call( Context ctx ) throws Throwable {

		if ( ctx.session().get( USER_ID ) != null )
			return delegate.call( ctx );
		return unauthorized();

	}

}
